package com.spring.lifecycle.bean;

public class HelloWorld {
    String hello="Hello demo";

    public HelloWorld() {
        System.out.println("world constructor...");
    }
    //初始化方法
    public void init(){
        System.out.println("通过@Bean指定init-method进行初始化。。。");
    }
    //销毁方法
    public void destory(){
        System.out.println("通过@Bean指定destroy-method进行销毁。。。");
    }

    @Override
    public String toString() {
        return "HelloWorld{" +
                "hello='" + hello + '\'' +
                '}';
    }
}